package com.company.kotlinlearn.lifecyc

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.company.kotlinlearn.R

private const val TAG = "LifecycleActivity"
class LifecycleActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Log.d(TAG, "onCreate: ")
        setContentView(R.layout.activity_lifecycle)
        // 监听生命周期
//        lifecycle.addObserver(MyLifecycleTest())
    }

    override fun onPause() {
        super.onPause()
        Log.d(TAG, "onPause: ")
    }

    override fun onResume() {
        super.onResume()
        Log.d(TAG, "onResume: ")
    }

    override fun onStart() {
        super.onStart()
        Log.d(TAG, "onStart: ")
    }

    override fun onDestroy() {
        super.onDestroy()
        Log.d(TAG, "onDestroy: ")
    }

    companion object {
    }
}